package challenge;
/**
 * 

 *     This file is part of ag41-print12-challenge.
 *     
 *     ag41-print12-challenge is free software: you can redistribute it and/or modify
 *     it under the terms of the GNU General Public License as published by
 *     the Free Software Foundation, either version 3 of the License, or
 *     (at your option) any later version.
 *     
 *     ag41-print12-challenge is distributed in the hope that it will be useful,
 *     but WITHOUT ANY WARRANTY; without even the implied warranty of
 *     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *     GNU General Public License for more details.
 *     
 *     You should have received a copy of the GNU General Public License
 *     along with ag41-print12-challenge.  If not, see <http://www.gnu.org/licenses/>.
 *     
 */

/**
 * 
 * @author Olivier Grunder
 * @version 0.01
 * @date 14 mai 2012
 *
 * @edit CHATELAIN Aurélien et CROISSANT Matthieu
 */
public class Main {
	private static int thread;
	private static int tabou;
	private static long tps;
	private static int limit;
	
	// ----------------------------------------
	public static void main(String[] args) {
		Problem pb;
		if(args.length>2){
			pb = new Problem(args[0]) ;
			thread = Integer.parseInt(args[1]);
			tabou = Integer.parseInt(args[2]);
			tps= Integer.parseInt(args[3]);
			limit= pb.np;
			}
		// Si aucune valeur n'est passée en paramètre :
		else {
			pb = new Problem("data/problem-011-200.txt") ;
			thread =10;
			tabou = 2000;
			tps = 30000;
			
		}
		long start= System.currentTimeMillis(); 
		
			System.out.println(" \n\r\n\r \n\r [ Démarrage de l'algorithme ] \n\r\n\r" + "PARAMETRES "  + "\n\rThread : " + thread + "\n\rDurée tabou : " + tabou + "\n\rtps :" + tps);
	
		Tabou[] tab = new Tabou[thread];
		
	/** Gestion du multi-thread -----------------
		for (int i=0; i<thread;++i){
			if(i==0){
				tab[i]= new Tabou(pb, tabou,thread,i,(tps)/(thread));
			}
			else{
				tab[i]= new Tabou(pb, tabou,thread,i,tps/(thread));
			}
		}**/ 
		
		tab[0]= new Tabou(pb, tabou,thread,0,(tps), limit);
		long end= System.currentTimeMillis();
		System.out.println("\n\rtemps execution : " +(end - start)+" milli-secondes"); 
		System.out.println("\n\r\n\r\n\r");
		
	}
}
